import React from 'react';

const FormTextarea = ({
  label,
  name,
  value,
  onChange,
  placeholder,
  required = false,
  error,
  rows = 3,
  className = '',
  ...props
}) => {
  return (
    <div className={className}>
      <label className="block text-sm font-medium text-gray-700">
        {label} {required && '*'}
      </label>
      <textarea
        name={name}
        value={value}
        onChange={onChange}
        placeholder={placeholder}
        required={required}
        rows={rows}
        className={`mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-primary-500 focus:border-primary-500 sm:text-sm font-mono transition-colors duration-200 ${
          error ? 'border-red-300 focus:border-red-500 focus:ring-red-500' : ''
        }`}
        style={{
          borderBottom: '2px solid',
          borderBottomColor: error ? '#fca5a5' : '#d1d5db',
          padding: '8px'
        }}
        {...props}
      />
      {error && (
        <p className="mt-1 text-sm text-red-600">{error}</p>
      )}
    </div>
  );
};

export default FormTextarea; 